<template>
	<z-paging ref="paging" :empty-view-center="false" :auto="false" :refresher-enabled="false">
		<view class="container">
			<view class="top">
				<text class="title">{{ msg.msgTitle }}</text>
				<view class="msg">
					<view class="msg_list">
						<image class="_list_img" src="/static/date.png" mode="widthFix"></image>
						<text class="_list_txt">{{ msg.updatedTime }}</text>
					</view>
					<view class="msg_list">
						<image class="_list_img" src="/static/creator.png" mode="widthFix"></image>
						<text class="_list_txt">系统</text>
					</view>
				</view>

				<view class="line"></view>
			</view>

			<view class="content">
				<text class="ctext">{{ msg.msgContent }}</text>
			</view>
		</view>
	</z-paging>
</template>

<script>
import { getNoticeDetails, idRead } from '../../../../../api/yuShuo';
import http from '@/common/request.js';
import { setLoadingToast } from '@/common/utils';
export default {
	data() {
		return {
			msg: {
				msgTitle: '',
				msgContent: '',
				createDate: ''
			}
		};
	},
	onLoad(options) {
		const D = JSON.parse(decodeURIComponent(options.item));
		const id = D.id;
		this.getDetails(id);
	},
	methods: {
		// 查询通知详情
		getDetails(id) {
			setLoadingToast('加载中...');
			getNoticeDetails(id).then((res) => {
				uni.hideLoading();
				if (res.code) {
					this.msg = res.data;
				}
			});
			idRead([id]).then((res) => {
				if (res.code) {
					uni.$emit('read', id);
				}
			});
		}
	}
};
</script>

<style scoped lang="scss">
.container {
	padding: 30rpx;

	.top {
		.title {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #333333;
			text-align: center;
		}

		.line {
			width: 690rpx;
			height: 2rpx;
			background: #d9d9d9;
			margin: 20rpx 0rpx;
		}

		.msg {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx 0 0 0;
			// border: 1rpx solid #ccc;

			.msg_list {
				display: flex;
				align-items: center;
				justify-content: center;

				._list_img {
					width: 35rpx;
				}

				._list_txt {
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
					padding: 0 15rpx;
				}
			}
		}
	}

	.content {
		padding: 10rpx 0;

		.ctext {
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #666666;
			line-height: 25px;
		}
	}
}

.bottomBtn {
	padding: 40rpx;
	background-color: #fff;
}
</style>
